     function postreply() {
		var id;
		var relaycontent;
		var xmlhttp;
		var xmlhttp = new XMLHttpRequest();
        
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			   if(xmlhttp.responseText==1){
				   document.getElementById("reply").innerHTML="帖子回复成功";
				   setTimeout("window.location.reload()",1000) ;
			   }else{
				   document.getElementById("reply").innerHTML="帖子回复失败";
	  	           setTimeout("window.location.reload()",1000) ;
			   }	
			 }
		};

		xmlhttp.open("POST","/index/index/postreply", true);
		xmlhttp.setRequestHeader("Content-type",
				"application/x-www-form-urlencoded");
		id = document.getElementById("id");
		content = document.getElementById("relaycontent");
		xmlhttp.send("id="+id.value+"&content="+content.value); 
	}
     
     function postEdit(node){
    	var dataid
 		var title;
 		var content;
 		var xmlhttp;
 		var xmlhttp = new XMLHttpRequest();
         
 		xmlhttp.onreadystatechange = function() {
 			if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
 			{
 	           if(xmlhttp.responseText==1)
 	           { 
 	        	  document.getElementById("reply").innerHTML="帖子更新成功";
				   setTimeout("window.location.reload()",1000) ;
 	           }else
 	           {
 	        	  document.getElementById("reply").innerHTML="帖子更新失败";
   	        	 setTimeout("window.location.reload()",1000) ;
 	           }
 			  
 			}
 		};
 		var id = node.getAttribute("data-id");
 		//var id= document.getElementById('id').value;
 		xmlhttp.open("POST","/index/index/postEdit", true);
 		xmlhttp.setRequestHeader("Content-type",
 				"application/x-www-form-urlencoded");
 		title = document.getElementById("title-"+id).value;
 		content = document.getElementById("content-"+id).value;
 		xmlhttp.send("title="+title+"&content="+content+"&id="+id); 
 	}
     
     function postDelete(node){
        var id;
        var pid;
  		var xmlhttp;
  		var xmlhttp = new XMLHttpRequest();
          
  		xmlhttp.onreadystatechange = function() {
  			if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  			{
  	           if(xmlhttp.responseText==2)
  	           { 
  	        	 document.getElementById("reply").innerHTML="主帖已删除，帖子不存在了";
				   setTimeout(self.location='/index/index/index',1000) ;
  	           }else if(xmlhttp.responseText==1)
  	           {
  	        	 document.getElementById("reply").innerHTML="回复帖删除成功";
  	        	 setTimeout("window.location.reload()",1000) ;
  	           }else{
  	        		document.getElementById("reply").innerHTML="帖子删除失败";
  	  	        	setTimeout("window.location.reload()",1000) ; 
  	        	 }
  			  }
  		};
  		xmlhttp.open("POST","/index/index/postDelete", true);
  		xmlhttp.setRequestHeader("Content-type",
  				"application/x-www-form-urlencoded");
  		id=node.getAttribute("data-id");
  		pid=node.getAttribute("data-pid");
  		xmlhttp.send("id="+id+"&pid="+pid); 
  	}